package me.seu.demo.exception;

/**
 * 自定义通用异常
 *
 * @author liangfeihu
 * @since 2020/3/7 10:53
 */
public class RestException extends RuntimeException {
    private int code = 500;
    private String msg;

    public RestException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public RestException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public RestException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public RestException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
